{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Python \t\t3.6\n",
      "Tensorflow \t1.0.0\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Keras \t\t2.0.3\n"
     ]
    }
   ],
   "source": [
    "import sys; print('Python \\t\\t{0[0]}.{0[1]}'.format(sys.version_info))\n",
    "import tensorflow as tf; print('Tensorflow \\t{}'.format(tf.__version__))\n",
    "import keras; print('Keras \\t\\t{}'.format(keras.__version__))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline \n",
    "\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Extracting ../mnist-data/train-images-idx3-ubyte.gz\n",
      "Extracting ../mnist-data/train-labels-idx1-ubyte.gz\n",
      "Extracting ../mnist-data/t10k-images-idx3-ubyte.gz\n",
      "Extracting ../mnist-data/t10k-labels-idx1-ubyte.gz\n"
     ]
    }
   ],
   "source": [
    "from tensorflow.examples.tutorials.mnist import input_data\n",
    "mnist = input_data.read_data_sets(\"../mnist-data/\", one_hot=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(55000, 784)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mnist.train.images.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2oAAABpCAYAAABLV9A4A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IiIiIJoxk1qdUpp5wCwGOPPVbnzxljavSNGzfO\ntV944QUADj30UNfXsWPHEEMsWQsWLADgBz/4geu77bbbAPjZz35WkDEl0X//+1/XvuSSS4D0Y9Pb\ncNYd5506dcrT6ERERBpu9erVrv3vf/+71p/zX89uueUWAHr06OH6dt11VwD22muv0EOUQDSjJiIi\nIiIikjD6oCYiIiIiIpIwWvooaexyR6h7yeNuu+3m2n379gXggw8+cH2TJqX2QFy0aBEADzzwgOsb\nM2ZM7oMtYW+99RYAm22W+q6lffv2hRpOYn388ceufffddwPQrFkz11dRUeHakydPBmDkyJF5Gl3y\n/etf/3LtE088EYDKysog1/33v//dtbt16wZAhw4dglx3U2aP0/79+7u+22+/HUgv4uQf503ZihUr\nABg0aJDrO/DAAwEYPny46+vcuXPQ2/3Pf/7j2v/85z+B1GshwBZbbBH09qR0TZkyxbXt43/69Omu\nb+HChbX+rn96hH3u/uabb2r83MaNG3McpcRFM2oiIiIiIiIJoxk1AVIzC08++WSNy/wTT+1MWevW\nrV3ftttuC8D69etd3/777+/ab7/9NgCfffZZwBGXttmzZwOp7CE14yGwcuVKAIYOHVrgkRS3qVOn\nunamb2Fz4c+633vvvQA8/PDDQW+jqfCfO/1ZM8sWEBo2bJjr22qrreIfWIH4hRR23313IH2Gq127\ndkD4WTT/dnr16uX6Vq1aBaTP0Hft2jX4bRfSmjVrALjssstc39y5c4FUwTDQTGJjLF682LX/9Kc/\nATB+/HjXZ7dFAoiiqEHX/f777+c4Oik0zaiJiIiIiIgkjD6oiYiIiIiIJEzRLH2cOHGia9uiADvt\ntJPra9GiBQBnnHGG6/vud78LQJcuXfIxxKK2fPlyIH1a3S559Jc/lZWV1XodY8eOde358+fXuLxf\nv345j7OUzZkzx7Vt8YAhQ4YUajiJY/eRA3jqqacAePPNN7P+/RkzZgDpjwG7t8whhxwSYohFY8OG\nDQA888wzsd2Gv4fdzTffDKTve7fNNtvEdtvFxharAFi2bFmNy0877TQg9TrYVNklhn7hELss9Kc/\n/an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cyxjxvjFlY9f8dCjA2ZRp+bMo0/NiKMlNIbq7KNJZxKdPw41Km4celTOMZW1HmqkzDS1SmURTl\n5T+gGbAY+D7QHHgb6J6v289x7GVAr6p2S2AB0B24Abisqv8y4A95HpcyVabKtARzVabKVJkqU2Wq\nXJVp0880nzNq+wGLoij6IIqi9cDDwIA83n6jRVG0PIqif1W1vwTmA+3ZNP4JVT82ATg+z0NTpuEp\n0/CKNlPF+aheAAABtElEQVRIbK7KNDxlGp4yDU+ZxqNoc1Wm4SUp03x+UGsPfOT9e2lVX1ExxnQG\negKvA+2iKFpeddEnQLs8D0eZhqdMw2sSmUKiclWm4SnT8JRpeMo0Hk0iV2UaXqEzVTGRBjDGbAs8\nDoyKomiNf1m0aR5Uex00kDINT5nGQ7mGp0zDU6bhKdPwlGl4yjS8JGSazw9qy4AO3r93ruorCsaY\nLdj0x3owiqInqro/NcaUVV1eBqzI87CUaXjKNLyizhQSmasyDU+ZhqdMw1Om8SjqXJVpeEnJNJ8f\n1N4EuhpjvmeMaQ6cCkzK4+03mjHGAH8G5kdRdLN30SRgaFV7KPB0noemTMNTpuEVbaaQ2FyVaXjK\nNDxlGp4yjUfR5qpMw0tUpqGqkmTzH3AMmyqnLAZ+lc/bznHcvdk0vfkOMLvqv2OAHYFpwELgBaBV\nAcamTJWpMi3BXJWpMlWmylSZKldl2rQzNVUDEhERERERkYRQMREREREREZGE0Qc1ERERERGRhNEH\nNRERERERkYTRBzUREREREZGE0Qc1ERERERGRhNEHNRERERERkYTRBzUREREREZGE+X+IUBJIT7+7\nfwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x119b4b3c8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(15,5))\n",
    "for i in list(range(10)):\n",
    "    plt.subplot(1, 10, i+1)\n",
    "    pixels = mnist.test.images[i]\n",
    "    pixels = pixels.reshape((28, 28))\n",
    "    plt.imshow(pixels, cmap='gray_r')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import tensorflow as tf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Set parameters\n",
    "learning_rate = 0.01\n",
    "training_iteration = 10\n",
    "batch_size = 250\n",
    "print_freq=1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# TF graph input\n",
    "x = tf.placeholder('float', [None, 784]) # mnist data image of shape 28*28=784\n",
    "y = tf.placeholder('float', [None, 10]) # 0-9 digits recognition => 10 classes\n",
    "\n",
    "keep_rate = tf.placeholder(tf.float32) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def weight_variable(shape):\n",
    "  initial = tf.constant(0.0, shape=shape)\n",
    "  return tf.Variable(initial)\n",
    "\n",
    "def bias_variable(shape):\n",
    "  initial = tf.constant(0.1, shape=shape)\n",
    "  return tf.Variable(initial)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "with tf.name_scope(\"hidden_1\") as scope:\n",
    "\n",
    "    # Set model weights\n",
    "    W_layer1 = weight_variable([784, 512])\n",
    "    b_layer1 = bias_variable([512])\n",
    "\n",
    "    # Construct a dense linear model, with act=relu and dropout\n",
    "    layer_1 = tf.nn.dropout(tf.nn.relu(tf.matmul(x, W_layer1) + b_layer1), keep_rate) # Relu, dropout\n",
    "        \n",
    "    # Add summary ops to collect data\n",
    "    tf.summary.histogram(\"W1_weights\", W_layer1)\n",
    "    tf.summary.histogram(\"B1_biases\", b_layer1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "with tf.name_scope(\"hidden_2\") as scope:\n",
    "\n",
    "    # Set model weights\n",
    "    W_layer2 = weight_variable([512, 512])\n",
    "    b_layer2 = bias_variable([512])\n",
    "\n",
    "    # Construct a dense linear model, with act=relu and dropout\n",
    "    layer_2 = tf.nn.dropout(tf.nn.relu(tf.matmul(layer_1, W_layer2) + b_layer2), keep_rate) # Relu, dropout\n",
    "    \n",
    "    # Add summary ops to collect data\n",
    "    tf.summary.histogram(\"W2_weights\", W_layer2)\n",
    "    tf.summary.histogram(\"B2_biases\", b_layer2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "with tf.name_scope(\"output\") as scope:\n",
    "\n",
    "    # Set model weights\n",
    "    W_layer3 = weight_variable([512, 10])\n",
    "    b_layer3 = bias_variable([10])\n",
    "\n",
    "    # Construct a dense linear model, with act=relu and dropout\n",
    "    layer_3 = tf.add(tf.matmul(layer_2, W_layer3), b_layer3)\n",
    "    \n",
    "    # Add summary ops to collect data\n",
    "    tf.summary.histogram(\"W3_weights\", W_layer3)\n",
    "    tf.summary.histogram(\"B3_biases\", b_layer3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#unscaled log probabilities\n",
    "y_hat = layer_3\n",
    "\n",
    "#model output\n",
    "y_out = tf.nn.softmax(y_hat)\n",
    "\n",
    "# More name scopes will clean up graph representation\n",
    "with tf.name_scope(\"cost_function\") as scope:\n",
    "    # Minimize error using cross entropy\n",
    "    # Cross entropy\n",
    "    cost_function = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y,logits=y_hat))\n",
    "    # Create a summary to monitor the cost function\n",
    "    tf.summary.scalar(\"cost_function\", cost_function)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "with tf.name_scope(\"train\") as scope:\n",
    "    # Gradient descent\n",
    "    optimizer = tf.train.AdamOptimizer().minimize(cost_function)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Initializing the variables\n",
    "init = tf.global_variables_initializer()\n",
    "\n",
    "# Merge all summaries into a single operator\n",
    "merged_summary_op = tf.summary.merge_all()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Launch the graph\n",
    "sess = tf.InteractiveSession()\n",
    "sess.run(init)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Change this to a location on your computer\n",
    "summary_writer = tf.summary.FileWriter('./tensorboard/tf', graph=sess.graph)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Iteration: 0000 cost= 0.683263521\n",
      "Iteration: 0001 cost= 0.189000007\n",
      "Iteration: 0002 cost= 0.123381180\n",
      "Iteration: 0003 cost= 0.088558772\n",
      "Iteration: 0004 cost= 0.071210058\n",
      "Iteration: 0005 cost= 0.056130819\n",
      "Iteration: 0006 cost= 0.045940143\n",
      "Iteration: 0007 cost= 0.038140648\n",
      "Iteration: 0008 cost= 0.032672639\n",
      "Iteration: 0009 cost= 0.028221791\n"
     ]
    }
   ],
   "source": [
    "# Training cycle\n",
    "for iteration in range(training_iteration):\n",
    "    avg_cost = 0.\n",
    "    total_batch = int(mnist.train.num_examples/batch_size)\n",
    "    # Loop over all batches\n",
    "    for i in range(total_batch):\n",
    "        batch_xs, batch_ys = mnist.train.next_batch(batch_size)\n",
    "        \n",
    "        # dropout placeholder\n",
    "        batch_kr = 0.75\n",
    "        \n",
    "        # Fit training using batch data\n",
    "        sess.run(optimizer, feed_dict={x: batch_xs, keep_rate: batch_kr, y: batch_ys})\n",
    "        \n",
    "        # Compute the average loss\n",
    "        avg_cost += sess.run(cost_function, feed_dict={x: batch_xs, keep_rate: batch_kr, y: batch_ys})/(total_batch+1)\n",
    "\n",
    "        # Write logs for each iteration\n",
    "        summary_str = sess.run(merged_summary_op, feed_dict={x: batch_xs, keep_rate:batch_kr, y: batch_ys})\n",
    "        summary_writer.add_summary(summary_str, iteration*total_batch + i)\n",
    "        \n",
    "    # Display logs per iteration step\n",
    "    if iteration % print_freq ==0 :\n",
    "        print(\"Iteration:\", '%04d' % (iteration), \"cost=\", \"{:.9f}\".format(avg_cost))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Accuracy: 0.9795\n"
     ]
    }
   ],
   "source": [
    "# Test the model\n",
    "predictions = tf.equal(tf.argmax(y_out, 1), tf.argmax(y, 1))\n",
    "\n",
    "# Calculate accuracy\n",
    "accuracy = tf.reduce_mean(tf.cast(predictions, \"float\"))\n",
    "print(\"Accuracy:\", accuracy.eval({x: mnist.test.images, keep_rate:1.0, y: mnist.test.labels}))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0: 6.0899251e-06,\n",
       " 1: 6.2345753e-06,\n",
       " 2: 4.9691484e-06,\n",
       " 3: 3.3737287e-08,\n",
       " 4: 3.3895682e-07,\n",
       " 5: 4.0409548e-05,\n",
       " 6: 0.99992764,\n",
       " 7: 2.2955151e-08,\n",
       " 8: 1.4148809e-05,\n",
       " 9: 1.5094564e-10}"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# test item #100 is a six\n",
    "pixels = mnist.test.images[100]\n",
    "\n",
    "#predict\n",
    "result = sess.run(y_out, feed_dict={x:[pixels], keep_rate:1.0})\n",
    "dict(zip(range(10), result[0]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def test_render(pixels, result, truth):\n",
    "    #pixels, result and truth are np vectors\n",
    "    plt.figure(figsize=(10,5))\n",
    "    plt.subplot(1, 2, 1)\n",
    "    pixels = pixels.reshape((28, 28))\n",
    "    plt.imshow(pixels, cmap='gray_r')\n",
    "\n",
    "    plt.subplot(1, 2, 2)\n",
    "    \n",
    "    #index, witdh\n",
    "    ind = np.arange(len(result))\n",
    "    width = 0.4\n",
    "\n",
    "    plt.barh(ind,result, width, color='orange', edgecolor='k', hatch=\"/\")\n",
    "    plt.barh(ind+width,truth,width, color='g', edgecolor='k')\n",
    "    plt.yticks(ind+width, range(10))\n",
    "    plt.margins(y=0)\n",
    "\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAEyCAYAAADeAVWKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHMpJREFUeJzt3X2QXXWd5/HPxwQWSLMDSJPq5sEgMkhk10B1RVgybhAf\nAkPB4LJAaoRIYZqyYIDRcgVdJe66u4yLMDO1waXVCDOLZHkcUvJcgMu6SqSjEQIRk2VAk26SIGOk\n0QU6fPePeyJtm845nXP7/s7Jeb+quvo+fHPupy+B/nDuOb/jiBAAAAB2zdtSBwAAAKgzyhQAAEAJ\nlCkAAIASKFMAAAAlUKYAAABKoEwBAACUQJkCAAAogTIFAABQAmUKAACghOmpAwBAHeyzzz4xe/bs\n1DEAdNCqVateiojuvDlzORkAyGc7+O8l0Cy2V0VEX94cH/MBaCzbl9leY/tp25enzgOgnihTABrJ\n9jGSFkuaK+m9kk6z/a60qQDUEWUKQFMdLWllRPwmIkYl/S9JH02cCUANUaYANNUaSX9i++2295F0\nqqRDE2cCUEOczQegkSJire2/kvSgpFclrZa0beyM7X5J/QniAagRzuYDAE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j0bEb7K7j6u1NE2VFPlnIEn/\nUa0i+/86Ga6AIvkXS1q6fWHcbLmdqiiSPyT98+z2H0ka6mC+XBHxmKSdnfRzhqS/i5bHJe037ozm\nSaNMAcBbdnR1hoMnmomIUUlbJb29I+nyFck/1oWS7pvSRJOX+zNkH8scGhH3dDJYQUX+GfyxpD+2\n/X9sP257Z3tROq1I/iWSPmZ7g6R7Jf1FZ6K1zWT/PcmV6nIyAICEbH9MUp+kf506y2TYfpukayV9\nPHGUMqar9RHTfLX2DD5m+19ExK+SpipuoaQbI+Kr2bV2/972Mdmiv43EnikAeEuRqzP8bsb2dLU+\n5vhlR9LlK3R1CdsflPR5SadHxGsdylZU3s+wr6RjJH03u/j88ZJWVOgg9CL/DDZIWhERb0TEP0r6\nmVrlqgqK5L9QrbX0FBE/kLSXWmsE1kXbr8JCmQKAtxS5OsPYFe7PkvRIVGfBvtz8to+VdINaRapK\nx+pst9OfISK2RsSBETErImapddzX6RExmCbuHyjyd+gf1NorJdsHqvWx33OdDLkTRfL/XNLJkmT7\naLXK1JaOpixnhaTzs7P6jpe0tewixXzMBwCZiBi1fYmkB/TW1Rmetv0fJA1GxAq1Lsfz97bXq3WQ\n67npEv++gvn/q6QuSbdlx83/PCJOTxZ6nII/Q2UVzP+ApA/bfkbSNkmfiYhK7N0smP/Tkr5u+y/V\nOhj94xX6H4rfu6JGdlzXVZL2kKSI+O9qHed1qqT1kn4j6YLSr1mhnx8AAKB2+JgPAACgBMoUAABA\nCZQpAACAEihTAAAAJVCmAAAASqBMAQAAlECZAgAAKOH/A59Mec3SDlI0AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x119ba9da0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import random\n",
    "i = random.randint(0,mnist.test.images.shape[0])\n",
    "\n",
    "pixels = mnist.test.images[i]\n",
    "truth  = mnist.test.labels[i]\n",
    "result = sess.run(y_out, feed_dict={x:[pixels], keep_rate:1.0})[0]\n",
    "\n",
    "test_render(pixels, result, truth)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "### What went wrong?\n",
    "pixels = mnist.test.images\n",
    "truth = mnist.test.labels\n",
    "\n",
    "feed_dict = {x:pixels}\n",
    "feed_dict.update({keep_rate:1.0})\n",
    "\n",
    "result = sess.run(y_out, feed_dict=feed_dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Incorrect predictions: 205\n"
     ]
    }
   ],
   "source": [
    "acc = result.argmax(axis=1) == truth.argmax(axis=1)\n",
    "incorrect = np.argwhere(acc==False).flatten()\n",
    "\n",
    "print(\"Incorrect predictions: {}\".format(len(incorrect)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABIEAAABdCAYAAAAyhXaGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcHGWdx/FPAYkgRwjHZkMgXIKAV4CEyAKKhKCg4iqi\nQORalmPZIEFZEwGVQzxYQMGDI8phUEAhCkiUAHIquCRAuENCDJeYACoBEYlQ+0fm2091zVMzPTM9\n3dXd3/frldfM9PR0V//yVHV1Pb/n90vSNMXMzMzMzMzMzNrbSs3eADMzMzMzMzMzG3y+CGRmZmZm\nZmZm1gF8EcjMzMzMzMzMrAP4IpCZmZmZmZmZWQfwRSAzMzMzMzMzsw7gi0BmZmZmZmZmZh3AF4HM\nzMzMzMzMzDrAgC4CJUnyoSRJ5idJsjBJkmn12qh24NjEOS7FHJs4x6WYYxPnuBRzbOIcl2KOTZzj\nUsyxiXNc4hyXYo5NnOMycEmapv37wyRZGXgcmAg8A9wD7J+m6SP127zW5NjEOS7FHJs4x6WYYxPn\n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AVwMca9Nx1k6bpc2ma3tv1/cvAo8CoAT5sy8fGcSnm\n2MQ5LsUcmzjHpZhjE+e4FHNs4hyXYo5NnONSzLGJc1ziBiku4NhENeoi0Cjg6czPz1Cf/9SmSZJk\nE2Bb4PddN01OkuSBJEkuSpJkeB8eqq1i47gUc2ziHJdijk2c41LMsYlzXIo5NnGOSzHHJs5xKebY\nxDkucXWMCzg2US4M3Q9JkqwBXA1MSdN0GXAesDkwBngOOKuJm9c0jksxxybOcSnm2MQ5LsUcmzjH\npZhjE+e4FHNs4hyXYo5NnOMS57gUq2dsGnUR6Flgo8zPG3bd1nKSJBnCiuD/OE3TmQBpmi5J0/SN\nNE3fBKazIu2sVm0RG8elmGMT57gUc2ziHJdijk2c41LMsYlzXIo5NnGOSzHHJs5xiRuEuIBjE9Wo\ni0D3AFskSbJpkiRDgf2Aaxv03HWTJEkC/BB4NE3TszO3j8zc7ePAQ3142JaPjeNSzLGJc1yKOTZx\njksxxybOcSnm2MQ5LsUcmzjHpZhjE+e4xA1SXMCxiVqlfptXLE3TfyZJMhm4gRUVui9K0/ThRjx3\nne0EHAg8mCTJ/V23nQDsnyTJGCAFFgNH1vqAbRIbx6WYYxPnuBRzbOIcl2KOTZzjUsyxiXNcijk2\ncY5LMccmznGJq3tcwLEpkqQrWo2ZmZmZmZmZmVkbc2FoMzMzMzMzM7MO4ItAZmZmZmZmZmYdwBeB\nzMzMzMzMzMw6gC8CmZmZmZmZmZl1AF8EMjMzMzMzMzPrAL4IZGZmZmZmZmbWAXwRyMzMzMzMzMys\nA/gikJmZmZmZmZlZB/h/mbVhVNZjZpwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x11b90a780>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(20,5))\n",
    "plt_idx = 1\n",
    "for i in list(incorrect[:16]):\n",
    "    plt.subplot(1, 16, plt_idx)\n",
    "    pixels = mnist.test.images[i]\n",
    "    pixels = pixels.reshape((28, 28))\n",
    "    plt.imshow(pixels, cmap='gray_r')\n",
    "    plt_idx += 1\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAEyCAYAAADeAVWKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHBVJREFUeJzt3X+QXXWd5vHnyQ8WpHGMJhO7CRB2YFKTZQiwLQviIIhY\nARVwF6ykYAZnqWmqlIGMuizjasEupZAZlBmrWNdGWNgs4PoDhhQLCsWPyTCljB2MJCSCWSZI0g1p\nBZX2Bxj47B/3BC493X1O59y+33Ny3q+qrr597rfPee4l5D4553vOcUQIAAAAe2ZW6gAAAAB1RpkC\nAAAogTIFAABQAmUKAACgBMoUAABACZQpAACAEihTAAAAJVCmAAAASqBMAQAAlDAndQAAqINZs2YF\nd4wA6m3O3DladuSywuPXr1//k4hYkDfO/OUAAPlsh65InQJAKVdI0+k9ttdHRH/eOA7zAWgs25fY\n3mT7cdurUucBUE+UKQCNZPsISX8m6VhJyyR9wPZhaVMBqCPKFICm+gNJj0TEryJil6S/l/TvE2cC\nUEOUKQBNtUnSH9l+m+03STpd0kGJMwGoIc7mA9BIEbHF9mpJ90r6paQNkl5pH2N7QNJAgngAaoQ9\nUwAaKyJuiIh/GxEnSnpB0pPjnh+MiP4iZ/MAaC72TAFoLNu/GxE7bR+s1nyp41JnAlA/XS1T8+fP\nj8WLF3dzkwASK3rRu0S+afttkn4r6WMR8bPUgQDUT6kyZXu5pL+VNFvSVyLi6qnGL168WENDQ2U2\nCaBmbD+dOsNkIuKPUmcAUH97XKZsz5Z0naRTJW2X9D3bayNic6fCAUBlWOIK6EC9LTxw4Yyst8ye\nqWMlbY2IpyTJ9lclnSmJMgVg7xNS3PLGRQ9tls75ovT1i6WTPzu921QA2HuUOZvvQEnPtP28PVsG\nAHu99iJ10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0T8\nPCLmR8TiiFis1ryvMyJiKE3cf6HIn6G/U2uvlGzPV+uw31PdDDmFIvl/LOkUSbL9B2qVqdGupixn\nraQ/yc7qO07Sz8tepJjDfACQiYhdti+S9G29fneGx23/N0lDEbFWrdvxrLG9Va1JrivSJX6jgvn/\nWlKPpK9n8+Z/HBFnJAs9TsHXUFkF839b0vtsb5b0iqT/FBGV2LtZMP8nJF1v+y/Umoz+kQr9g+IN\nd9TI5nVdLmmuJEXE/1BrntfpkrZK+pWkPy29zQq9fgAAgNrhMB8AAEAJlCkAAIASKFMAAAAlUKYA\nAABKoEwBAACUQJkCAAAogTIFAABQwv8HIx18ZvWpgC0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x123901c50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "i = random.choice(list(incorrect))\n",
    "\n",
    "pixels = mnist.test.images[i]\n",
    "truth  = mnist.test.labels[i]\n",
    "\n",
    "feed_dict = {x:[pixels]}\n",
    "feed_dict.update({keep_rate:1.0})\n",
    "result = sess.run(y_out, feed_dict=feed_dict)[0]\n",
    "\n",
    "test_render(pixels, result, truth)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Close the Session when we're done.\n",
    "# sess.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
